package Algorithm.Sort.FastSort;

public class Recursion {
    public static int recursion1(int num){
        if(num == 1){
            return 1;
        } else if(num < 0){
            return -1;
        }else {
            return recursion1(num-1) + num;
        }
    }
    public static int recursion2(int num){
        if(num == 1){
            return 1;
        } else if(num <= 0){
            return -1;
        }else {
            return recursion2(num-1) * num;
        }
    }
    public static void main(String[] args) {
        System.out.println(recursion1(5));
        System.out.println(recursion2(5));
    }
}
